{% load i18n lfs_tags %}
<h2>{% trans "Orders" %}</h2>

{% if not page.object_list %}
    <div>
        {% trans "No orders found." %}
    </div>
{% else %}
    <table class="lfs-manage-table">
        <tr>
            <th class="small">
                {% trans 'Number' %}
            </th>
            <th class="small">
                {% trans 'Date' %}
            </th>
            <th class="middle">
                {% trans "Name" %}
            </th>
            <th class="small">
                {% trans 'State' %}
            </th>
            <th class="tiny right-padding">
                {% trans 'Price' %}
            </th>
            <th class="small right-padding">
                {% trans 'Message' %}
            </th>
        </tr>
            {% for order in page.object_list %}
                <tr class="clickable {% cycle 'even' 'odd' %} order-state-{{ order.state }}"
                    onclick="window.location='{% url lfs.manage.views.order_view order.id %}'">
                    <td>
                        {{ order.number|default_if_none:"-" }}
                    </td>
                    <td>
                        {{ order.created|date:_("DATETIME_FORMAT") }}
                    </td>
                    <td>
                        {{ order.customer_firstname }}   {{ order.customer_lastname }}
                    </td>
                    <td>
                        {{ order.get_state_display }}
                    </td>
                    <td class="number">
                        {{ order.price|currency:request }}
                    </td>
                    <td class="right-padding">
                        {% if order.message %}
                            {% trans "Yes" %}
                        {% else %}
                            {% trans "No" %}
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        </table>
{% endif %}
